package com.ruijie.autotest.log.validation.paibo.tcp8848;

import com.mchange.v2.c3p0.ComboPooledDataSource;
import com.ruijie.autotest.log.core.validate.IValidator;
import com.ruijie.autotest.log.impl.validate.SolidValueValidator;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;

import javax.sql.DataSource;

import static com.ruijie.autotest.log.impl.validate.SqlExistingValidator.sqlExistingVerificationOf;

@SpringBootConfiguration
public class ValidatorsConfig {
	@Bean
	public DataSource dataSource() {
		return new ComboPooledDataSource("remote");
	}

	@Bean
	public IValidator versionValidator() {
		return new SolidValueValidator("1.0.0");
	}

	@Bean
	public IValidator eventTypeValidator() {
		return new SolidValueValidator("40");
	}

	@Bean
	public IValidator docVersionValidator() {
		return new SolidValueValidator("4.3.3");

	}

	@Bean
	public IValidator authTypeValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.auth_type", dataSource);

	}

	@Bean
	public IValidator authAccountValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.auth_account", dataSource);

	}

	@Bean
	public IValidator idTypeValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.auth_type", dataSource);

	}

	@Bean
	public IValidator idCodeValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.auth_account", dataSource);

	}

	@Bean
	public IValidator idNameValidator() {
		// FIXME 2021/1/15  wait for me!!!    unknown
		return new SolidValueValidator("");
	}

	@Bean
	public IValidator appCompanyValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.app_company_name", dataSource);

	}

	@Bean
	public IValidator appNameValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.app_software_name", dataSource);

	}

	@Bean
	public IValidator appVersionValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.app_version", dataSource);

	}

	@Bean
	public IValidator appAuthcodeValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.appid", dataSource);

	}

	@Bean
	public IValidator locationCodeValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("s_location.code", dataSource);

	}

	@Bean
	public IValidator locationTypeValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("s_location.type_id", dataSource);

	}

	@Bean
	public IValidator loginAtValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.start_time", dataSource);

	}

	@Bean
	public IValidator logoutAtValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.end_time", dataSource);

	}

	@Bean
	public IValidator macValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.mac", dataSource);

	}

	@Bean
	public IValidator lanIpValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.ip_address", dataSource);

	}

	@Bean
	public IValidator sourceIp4Validator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.src_ip", dataSource);

	}

	@Bean
	public IValidator sourceIp6Validator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.src_ipv6", dataSource);

	}

	@Bean
	public IValidator sourceStartport4Validator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.src_port_start", dataSource);

	}

	@Bean
	public IValidator sourceEndport4Validator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.src_port_end", dataSource);

	}

	@Bean
	public IValidator sourceStartport6Validator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.src_port_start_v6", dataSource);

	}

	@Bean
	public IValidator sourceEndport6Validator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.src_port_end_v6", dataSource);

	}

	@Bean
	public IValidator apidValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.collection_equipment_id", dataSource);

	}

	@Bean
	public IValidator apmacValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.ap_mac", dataSource);

	}

	@Bean
	public IValidator longitudeValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("s_device.longitude", dataSource);

	}

	@Bean
	public IValidator latitudeValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("s_device.latitude", dataSource);

	}

	@Bean
	public IValidator rssiValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.terminal_field_strength", dataSource);

	}

	@Bean
	public IValidator sessionidValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.session_id", dataSource);

	}

	@Bean
	public IValidator xValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.x_coordinate", dataSource);

	}

	@Bean
	public IValidator yValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.y_coordinate", dataSource);

	}

	@Bean
	public IValidator imsiValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.imsi", dataSource);

	}

	@Bean
	public IValidator deviceIdValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.imei_esn_meid", dataSource);

	}

	@Bean
	public IValidator terminalSystemValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.os_name", dataSource);

	}

	@Bean
	public IValidator terminalBrandValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.brand", dataSource);

	}

	@Bean
	public IValidator terminalBrandtypeValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.model", dataSource);

	}

	@Bean
	public IValidator sourceValidator() {
		// FIXME 2021/1/15  wait for me!!!    unknown
		return new SolidValueValidator("");

	}

	@Bean
	public IValidator ispIdValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("s_location.operator_net_id", dataSource);

	}

	@Bean
	public IValidator wanIpValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.src_ip", dataSource);

	}

	@Bean
	public IValidator sourcePortValidator() {
		// FIXME 2021/1/15  wait for me!!!    unknown
		return new SolidValueValidator("");

	}

	@Bean
	public IValidator ssidValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.ssid", dataSource);

	}

	@Bean
	public IValidator associatedValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("eg_auth_log.ssid", dataSource);

	}

	@Bean
	public IValidator floorValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("s_device.floor", dataSource);

	}

	@Bean
	public IValidator loginTypeValidator() {
		// FIXME 2021/1/15  wait for me!!!   unknown
		return new SolidValueValidator("");

	}

	@Bean
	public IValidator plastersignValidator() {
		// FIXME 2021/1/15  wait for me!!!   unknown
		return new SolidValueValidator("");

	}

	@Bean
	public IValidator metroStationInfoValidator() {
		// FIXME 2021/1/15  wait for me!!!   unknown
		return new SolidValueValidator("");
	}
}
